<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
    <script src="/js/lay-module/echarts/echarts.min.js" charset="utf-8"></script>
</head>

<body>
    <div id="main" style="width: 600px; height:400px;"></div>

</body>
<script>
    var chartDom = document.getElementById('main');
        var myChart = echarts.init(chartDom);
        var option;



    debugger
    $.ajax({
            url:"http://localhost:8080/medical/armarium/echarBar",
            data:{},
            success:function(result){
                console.log(result.data)
                var List = [];
                var Count = [];
                var arr = result.data.amountBar;
                for(var i = 0; i < arr.length; i++){
                    List.push(arr[i].armarium_id);
                    Count.push(arr[i].armarium_amount);
                }
                // console.log('floorList'+ floorList)
                // console.log('floorCount'+ floorCount)


                option = {
            title:{
                        text:'比例柱状图'
                    },
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
            xAxis: {
                type: 'category',
                data: List
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    data: Count,
                    type: 'bar',
                    showBackground: true,
                    backgroundStyle: {
                        color: 'rgba(180, 180, 180, 0.2)'
                    }
                }
            ]
        };

        myChart.setOption(option);
        },
        dataType: "json"
    })



</script>

</html>